package com.kehutong.common.entity;

import org.coraframework.orm.Entity;
import org.coraframework.orm.annotation.Column;
import org.coraframework.orm.annotation.Table;

import java.time.LocalDateTime;

@Table("t_oauth_client")
public class OAuthClient extends Entity {

	private static final long serialVersionUID = 6439940997143288944L;

	protected OAuthClient(String id) {
		super(id);
	}

	@Column(comment="归属公司编号")
	private String companyNo;

	@Column(comment="归属公司名称")
	private String companyName;

	@Column(comment="应用id")
	private String appid;

	@Column(comment="length=255, 应用secret")
	private String secret;

	@Column(comment="调用白名单[]")
	private String whiteIp;

	@Column(comment="跳转url")
	private String redirectUri;

	@Column(length=255, comment="事件回调地址")
	private String callBackUrl;

	@Column(comment="授权code")
	private String code;

	@Column(comment="授权code过期时间")
	private LocalDateTime codeExpiresTime;

	@Column(length=128, comment="access_token")
	private String accessToken;

	@Column(comment="access_token过期时间")
    private LocalDateTime tokenExpiresTime;

	@Column(comment="是否删除")
	private boolean deleted;

	public String getCompanyNo() {
		return companyNo;
	}

	public void setCompanyNo(String companyNo) {
		this.companyNo = companyNo;
	}

	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	public String getAppid() {
		return appid;
	}

	public void setAppid(String appid) {
		this.appid = appid;
	}

	public String getSecret() {
		return secret;
	}

	public void setSecret(String secret) {
		this.secret = secret;
	}

	public String getRedirectUri() {
		return redirectUri;
	}

	public void setRedirectUri(String redirectUri) {
		this.redirectUri = redirectUri;
	}

	public boolean isDeleted() {
		return deleted;
	}

	public void setDeleted(boolean deleted) {
		this.deleted = deleted;
	}

	public String getWhiteIp() {
		return whiteIp;
	}

	public void setWhiteIp(String whiteIp) {
		this.whiteIp = whiteIp;
	}

	public String getCallBackUrl() {
		return callBackUrl;
	}

	public void setCallBackUrl(String callBackUrl) {
		this.callBackUrl = callBackUrl;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public LocalDateTime getCodeExpiresTime() {
		return codeExpiresTime;
	}

	public void setCodeExpiresTime(LocalDateTime codeExpiresTime) {
		this.codeExpiresTime = codeExpiresTime;
	}

	public String getAccessToken() {
		return accessToken;
	}

	public void setAccessToken(String accessToken) {
		this.accessToken = accessToken;
	}

	public LocalDateTime getTokenExpiresTime() {
		return tokenExpiresTime;
	}

	public void setTokenExpiresTime(LocalDateTime tokenExpiresTime) {
		this.tokenExpiresTime = tokenExpiresTime;
	}
}
